1. Field of the Invention
The present invention relates generally to systems and methods for rendering graphic images on a display device. In particular, the present invention relates to systems and method for performing blending operations. Still more particularly, the present invention relates to a system and a method for performing alpha blending using an over-sampling buffer.
2. Description of the Background Art
In computer graphics and image processing, an image is composed of an array of values. Each value in the array or multiple values in the array correspond to a respective picture element or pixel. Each pixel is preferably represented by a plurality of quantities that specify color, shading or other pixel characteristics.
One important graphics operation is blending. In particular, alpha blending is conventional 3D process that gives a computer-generated image the effect of transparency. Blending occurs when two images must be combined on a pixel-by-pixel basis to produce a composite image. In combining the images, one image is defined as the foreground or source image and the other image is defined as the background or destination image. The combination of the foreground and background images is accomplished through a weighted ratio between corresponding pixels in each image, where each pixel's characteristics are based on a blending value. The blending value indicates a fractional constant, C, by which the foreground and background pixels are weighted. The foreground pixels are weighted by C, and the background pixels are weighted by 1-C. The weighted foreground and background pixels are then summed and averaged on a pixel-by-pixel basis to create a new composite image.
One such prior art method for performing alpha blending in the context of a graphic engine or accelerator is shown in FIG. 1. As shown the process for performing blending begins by retrieving a source color for a pixel in step 100, retrieving a destination color for a pixel in step 102, and retrieving a blend value C in step 104. Then in step 106, the new value for the destination color is generated by computing the value, x=A.multidot.C+B.multidot.(1-C). Finally, in step 108, the generated blend value is stored back in a frame buffer. Thus, each blending operation requires a memory read of the destination color, a blending of the source color with the destination color, and a memory write operation.
In certain image processing applications, the amount of time available for performing the required calculations for realistically displaying an image transformation is severely limited. Current technology has made image sizes of 1024.times.768, or 800.times.600 pixels commonplace. Blending the pixels of two images to form a composite image must be done on a pixel-by-pixel basis, and therefore, requires millions of computational operations. The computational time constraints are particularly severe in interactive computer graphics situations, in which a computer user influences or directs entire sequences of displayed images. Alpha blending is frequently required in such situations and must be performed as quickly as possible.
When alpha blending is performed, this operation is performed for each pixel, as has been noted above. Eight times over sampling requires eight times more computation and bandwidth per pixel. Further, when eight times over sampling and alpha blending are performed, the computational requirements for alpha blending increase by eight. This results in significant degradation in performance because it requires eight read/modify/write operations to perform one a blend operation per pixel. Thus, when used with an over sampling buffer, the process for alpha blending requires more operations, making it prohibitively expensive.
Therefore, there is a need for an efficient system and method for performing alpha blending when used with an over sampling buffer.